package com.ycl.bookstore.controller;


import com.ycl.bookstore.common.Result;
import com.ycl.bookstore.service.RechargeRecordService;
import jakarta.annotation.Resource;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/record")
public class RechargeController {

    @Resource
    private RechargeRecordService rechargeRecordService;

    @Resource
    private StringRedisTemplate stringRedisTemplate;


    @GetMapping("/list")
    public Result getListByPage(@RequestParam("pageNo") Long pageNo,
                                @RequestParam("pageSize") Long pageSize,
                                @RequestParam(value = "recordId",required = false) String recordId){
        return rechargeRecordService.getListByPage(pageNo,pageSize,recordId);
    }

    @DeleteMapping("/delete")
    public Result deleteRecord(@RequestParam String recordId){
        return rechargeRecordService.deleteRecord(recordId);
    }
}
